# @Time: 2025/3/13 20:34
# @Author: chenhui
class LeftMenuBase:
    def level_one_menu(self, menu_name):
        """
        一级菜单栏定位元素
        //aside[@class='el-aside']//span[text()='首页']/parent::li
        //aside[@class='el-aside']//span[text()='首页']/ancestor::li
        :return:
        """
        return "//aside[@class='el-aside']//span[text()='" + menu_name + "']/ancestor::li"
    def level_two_menu(self, menu_name):
        """
        二级级菜单栏定位元素
        //aside[@class='el-aside']//span[text()='首页']/parent::li
        //aside[@class='el-aside']//span[text()='首页']/ancestor::li  不能用这个，能定位到多个
        :return:
        """
        return "//aside[@class='el-aside']//span[text()='" + menu_name + "']/parent::li"


